<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.CreateContentTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form>
                <h:panelGrid columns="2">
                    <h:outputLabel value="#{bundle.CreateContentLabel_idContent}" for="idContent" />
                    <h:inputText id="idContent" value="#{contentController.selected.idContent}" title="#{bundle.CreateContentTitle_idContent}" required="true" requiredMessage="#{bundle.CreateContentRequiredMessage_idContent}"/>
                    <h:outputLabel value="#{bundle.CreateContentLabel_contentName}" for="contentName" />
                    <h:inputText id="contentName" value="#{contentController.selected.contentName}" title="#{bundle.CreateContentTitle_contentName}" />
                    <h:outputLabel value="#{bundle.CreateContentLabel_contentUrl}" for="contentUrl" />
                    <h:inputText id="contentUrl" value="#{contentController.selected.contentUrl}" title="#{bundle.CreateContentTitle_contentUrl}" />
                    <h:outputLabel value="#{bundle.CreateContentLabel_idForm}" for="idForm" />
                    <h:selectOneMenu id="idForm" value="#{contentController.selected.idForm}" title="#{bundle.CreateContentTitle_idForm}" >
                        <f:selectItems value="#{formController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                    <h:outputLabel value="#{bundle.CreateContentLabel_idChapter}" for="idChapter" />
                    <h:selectOneMenu id="idChapter" value="#{contentController.selected.idChapter}" title="#{bundle.CreateContentTitle_idChapter}" >
                        <f:selectItems value="#{chapterController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                </h:panelGrid>
                <br />
                <h:commandLink action="#{contentController.create}" value="#{bundle.CreateContentSaveLink}" />
                <br />
                <br />
                <h:commandLink action="#{contentController.prepareList}" value="#{bundle.CreateContentShowAllLink}" immediate="true"/>
                <br />
                <br />
                <h:link outcome="/index" value="#{bundle.CreateContentIndexLink}"/>
            </h:form>
        </ui:define>
    </ui:composition>

</html>
